/**
 * @file ui_config.h
 * @author your name (you@domain.com)
 * @brief config for msg event
 * @version 0.1
 * @date 2023-05-28
 * 
 * @copyright Copyright (c) 2023
 * 
 */

#ifndef UI_CONFIG_H
#define UI_CONFIG_H

#include "frame.h"
#include <stdint.h>
#include <stdbool.h>

#ifdef __cplusplus
extern "C"
{
#endif

#define APP_NAME_KEY "Name"
#define APP_NAME "EasyUI"
#define APP_VER_KEY "Version"
#define APP_VER  "V1.0.0.0"

#define TOP_UI_HEIGHT_RATE 0.1
#define TOP_UI_BG_COLOR    0xaaaaaa  

#define TOAST_UI_HEIGHT_RATE 0.10
#define TOAST_UI_SHOW_TIME   2000
#define TOAST_UI_INFO_COLOR 0x004620
#define TOAST_UI_WARNING_COLOR 0xcc5500
#define TOAST_UI_ERROR_COLOR 0xcc0033
#define TOAST_UI_TEXT_COLOR  0xFFFFFF

#define HOME_UI_BG_COLOR     0x000000

#define INFO_LIST_TILE_HEIGHT_RATE 0.1
#define INFO_LIST_ITEM_HEIGHT      72
#define INFO_LIST_UP_LABEL_COLOR   0xaaaaaa
#define INFO_LIST_DOWN_LABEL_COLOR 0xFFFFFF
#define INFO_LIST_DOWN_LINE_COLOR  0x101010
#define INFO_LIST_TITLE_COLOR      0xFFFFFF
#define INFO_LIST_DOWN_LINE_WIDTH  1

#define SCREEN_GESTURE_SWIP_MIN_PIXEL 30
#define SCREEN_GESTURE_PULL_REGION_WIDTH 30

#define HOME_UI_ITEM_HOME      "Setting"
#define HOME_UI_ITEM_ABOUT     "About"
#define HOME_UI_ITEM_APP       "APP"

typedef ui_basic_com_t* (*ui_create)(void);

/*define ui enum*/
typedef enum easy_ui_id
{
    //in main page, switch page via left/right swip
    EASY_UI_HOME,
    EASY_UI_APP_MAIN,
    EASY_UI_ABOUT_MAIN,
    
    EASY_UI_TOP = 0x10000000,
    EASY_UI_POWER_ON,
    EASY_UI_ABOUT_DETAIL,
    EASY_UI_APP_IMG,

}easy_ui_id_e;

typedef struct easy_ui_page_info
{
    easy_ui_id_e id;
    ui_create  page;

}easy_ui_page_info_t;


/*get ui name*/
#define EASY_UI_NAME(ui_id)  #ui_id

extern easy_ui_page_info_t g_main_ui_array[];
extern easy_ui_page_info_t g_sub_ui_array[];

int ui_main_array_len(void);
int ui_sub_array_len(void);
easy_ui_page_info_t *ui_page_get(easy_ui_id_e id);
int ui_is_main_page(easy_ui_id_e id);
int ui_is_sub_page(easy_ui_id_e id);
#ifdef __cplusplus
}
#endif


#endif







